@extends('home.layout');
@section('content')
<style type="text/css">
table.gridtable {
	font-family: verdana,arial,sans-serif;
	font-size:16px;
	color:#333333;
	width: 1200px;
	float: left;
	
	
}
table.gridtable th {
	border-width: 1px;
	padding: 8px;
	
	
	background-color: #f9f9f9;
	width: 100px;
	height:50px;
}
table.gridtable td {
	
	padding: 8px;
	
	border-color: #666666;
	background-color: #ffffff;
}
.page ul li
{
	font-size: 20px;
	width: 30px;
	height: 30px;
	margin-right:10px; 
	background: #EEEEEE;
	line-height: 30px;
	float: left;
}
</style>

<div style="width: 1200px;margin: 40px auto;height: 800px;">

	
    @if(session('success'))
        <h3 style="color: #f69;">
            {{session('success')}}
        </h3>
    @endif
    <div style="width: 1200px;float: left">
		<div style="float: left;"> 
		<form action="/home/goods/index" method="get">
			<select name="num" style="width: 100px;">
	            <option
	                @if(!empty($request['num']) && $request['num'] == 10)
	                    selected
	                @endif
	            >10</option>
	            <option
	                @if(!empty($request['num']) && $request['num'] == 20)
	                    selected
	                @endif
	            >20</option>
	            <option
	                @if(!empty($request['num']) && $request['num'] == 50)
	                    selected
	                @endif
	            >50</option>
	            <option
	                @if(!empty($request['num']) && $request['num'] == 100)
	                    selected
	                @endif
	            >100</option>
	            <option
	                @if(!empty($request['num']) && $request['num'] == 150)
	                    selected
	                @endif
	            >150</option>
	        </select>
	        显示页数
	    </div>
	    <div style="float: right;">商品名称:  <input value="{{$request['keywords'] or ''}}" name="keywords" type="text" >
	          <span>
	               <button style="background: #ff6699 none repeat scroll 0 0;border: 0 solid #ff6699;color: white;height: 22px;width: 40px">搜索</button>
	          </span>
	    </div>
   </div>
   </form>
	<table class="gridtable">
	<tr>
		
        <th>商品名称</th>
        <th>商品logo</th>
        <th>商品描述</th>
        <th>商品价格</th>
        
        <th>商品板块</th>
        <th>商品类目</th>
        <th>状态</th>
        <th>销量</th>
        <th>商品库存</th>
        <th>操作</th>
	</tr>
	<tr>
		 @foreach($data as $goods)
        <tr>
            
            <td>{{$goods -> goodsname}}</td>
            <td><img src="{{$goods -> logo}}" width="50px"></td>
            <td>{{$goods -> description}}</td>
            <td>{{$goods -> value}}</td>
            
            <td>{{$goods -> name}}</td>
            <td>{{$goods -> type}}</td>
            <td>
                @if($goods -> status ==1)
                    在售
                @else
                    下架
                @endif
            </td>
            <td>{{$goods -> inventory}}</td>
            <td>{{$goods -> sellnum}}</td>
            <td><a href="/home/goods/edit/{{$goods->id}}">编辑</a>  <a href="/home/goods/delete/{{$goods->id}}">删除</a></td>
        </tr>
        @endforeach
	</tr>
	
	</table>
	<div class ="page" style="width: 1200px;float: left;margin-top:10px; ">{!! $data->appends($request)->render() !!}</div>
</div>


@endsection